package com.eastedu.superise.handler.assignmen;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.eastedu.repository.assignment.mapper.AssignmentMapper;
import com.eastedu.repository.assignment.po.AssignmentPO;
import com.eastedu.superise.handler.AbstractHistoricalDataHandler;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.sql.SQLException;

/**
 * 更新应用者
 * @author zhangzhishuai
 */
@Slf4j
@Service
@DS("assignment")
@RequiredArgsConstructor
public class AssignmentApplyUserIdHistoricalDataHandler extends AbstractHistoricalDataHandler<AssignmentPO> {

    private final AssignmentMapper assignmentMapper;


    @Override
    protected String getSql() {
        return "SELECT * FROM t_assignment_resource WHERE owner_id = 1343665";
    }

    @Override
    public void callback(AssignmentPO po) throws SQLException {
        int provider = 1343655;
        assignmentMapper.updateProvider(provider, po.getId());
    }
}
